package communication;

public abstract class Connection{
		

	protected abstract void doSend(boolean bool)
	throws ConnectionException;	
	
	protected abstract void doSend(Object obj)
	throws ConnectionException;

	protected abstract void doSend(String str)
	throws ConnectionException;

	protected abstract void doSend(long l)
	throws ConnectionException;	
	
	protected abstract void doSend(byte [] buffer)
	throws ConnectionException;	

	protected abstract void doSend(byte [] buffer,int init, int length)
	throws ConnectionException;
	
	protected abstract Object doReceiveObject()
	throws ConnectionException;

	protected abstract int doReceiveBytes(byte [] buffer)
	throws ConnectionException;
	
	protected abstract String doReceiveString()
	throws ConnectionException;
	
	protected abstract long doReceiveLong()
	throws ConnectionException;
	
	protected abstract int doReceiveInt()
	throws ConnectionException;
	
	protected abstract boolean doReceiveBoolean()
	throws ConnectionException;
		
	protected abstract void doFlush()
	throws ConnectionException;
		
	protected abstract void doClose()
	throws ConnectionException;
	
	

	public  void send(boolean bool)
	throws ConnectionException{
		doSend(bool);
	}
		
	public  void send(Object obj)
	throws ConnectionException{
		doSend(obj);
	}

	public  void send(String str)
	throws ConnectionException{
		doSend(str);
	}

	public  void send(long l)
	throws ConnectionException{
		doSend(l);
	}

	public  void send(byte [] buffer)
	throws ConnectionException{
		doSend(buffer);
	}	

	public  void send(byte [] buffer,int init, int length)
	throws ConnectionException{
		doSend(buffer,init,length);
	}

	public Object receiveObject()
	throws ConnectionException{
		return doReceiveObject();
	}	


	public boolean receiveBoolean()
	throws ConnectionException {
		return doReceiveBoolean();
	}

	public  int receiveBytes(byte [] buffer)
	throws ConnectionException{
		return doReceiveBytes(buffer);
	}

	public String receiveString()
	throws ConnectionException{
		return doReceiveString();
	}

	public long receiveLong()
	throws ConnectionException{
		return doReceiveLong();
	}

	public int receiveInt()
	throws ConnectionException{
		return doReceiveInt();
	}
	
	public void flush()
	throws ConnectionException{
		doFlush();
	}

	public void close()
	throws ConnectionException{
		doClose();
	}

	
}
